package singleton;

/**
 * @program: thread
 * @description:静态内部类
 * @author: gongj
 * @Description: TODO
 * @create: 2020-07-11 23:03
 **/
public class SingletonTest3 {

    private SingletonTest3(){
        System.out.println("无参构造方法执行");
    }
    private static class SingletonInstance{
        private static final SingletonTest3 INIT_SINGLETON = new SingletonTest3();
    }
    public static SingletonTest3 getInstance(){
        return SingletonInstance.INIT_SINGLETON;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 60; i++) {
            new Thread(()->{
                System.out.println(SingletonTest3.getInstance());
            }).start();
        }
    }
}
